home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS05.ADF
/
menudemo
/
demo.c
< prev
next >
Wrap
C/C++ Source or Header
|
1986-01-15
|
4KB
|
112 lines
/*********************************************************************/
/* demo.c AmigaLink 1/25/86 */
/* Copyright (c) 1985 */
/* Commodore-Amiga, Inc. */
/* All rights reserved. */
/* */
/* No part of this program may be reproduced, transmitted, */
/* transcribed, stored in retrieval system, or translated */
/* into any language or computer language, in any form or */
/* by any means, electronic, mechanical, magnetic, optical, */
/* chemical, manual or otherwise, without the prior written */
/* permission of: */
/* Commodore-Amiga, Inc. */
/* 983 University Ave #D */
/* Los Gatos, CA. 95030 */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Program name: demo */
/* Programmer: Andy Finkel */
/* */
/* Purpose: To demo some Intuition functions, like menus. */
/* */
/*********************************************************************/
#include "standard.h"
#include "workbench/startup.h"
#define MENUPROJECT 0
#define MENUEDIT 1
#define MENUSTYLES 2
#define MENUCOLORS 3
#define BLUE 0
#define WHITE 1
#define BLACK 2
#define RED 3
ULONG GfxBase;
ULONG IntuitionBase;
ULONG DosBase;
ULONG DiskfontBase;
ULONG IconBase;
extern struct MsgPort consoleMsgPort;
extern struct Window *OpenWindow();
extern struct Window *window;
extern struct IntuiMessage *message;
ULONG WakeUpBit;
main(wbmessage,argv)
struct WBStartup *wbmessage;
char *argv[];
{
int inChar; /* character coming from the console */
UBYTE str[80];
startup(wbmessage,argv); /* startup menu, fonts, etc */
while (TRUE) /* all the time in fact ! */
{
WakeUpBit= Wait((1<<window->UserPort->mp_SigBit)|
(1<<consoleMsgPort.mp_SigBit));
/* first check if it was an intuition message */
if(WakeUpBit & (1<<window->UserPort->mp_SigBit))
{
while(message=(struct IntuiMessage *)
GetMsg(window->UserPort))
{
switch(message->Class)
{
case CLOSEWINDOW:
closewindow(message,window);
break;
case REFRESHWINDOW:
BeginRefresh(window);
CDPutStr("Refresh Message\r\n");
EndRefresh(window,TRUE);
ReplyMsg(message);
break;
case MENUPICK:
if((message->Code)!=MENUNULL)
MenuPick(message,window);
ReplyMsg(message);
break;
default:
ReplyMsg(message);
}
}
}
/* now check if there was a console (got key) message */
if(WakeUpBit & (1<<consoleMsgPort.mp_SigBit)) {
while((inChar=CDMayGetChar()) != (-1) ){/* char waiting */
CDPutChar(inChar);
}
}
}
}